﻿<Page
    x:Name="pageRoot"
    x:Class="SharPy.GamePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SharPy"
    xmlns:common="using:SharPy.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Loaded="Page_Loaded"
    xmlns:st="using:SharPy.GameSettings">

    <Page.Resources>
        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
    </Page.Resources>
    
    <Grid Name="gridMain">       
        <Grid.RowDefinitions>
            <RowDefinition Height="4*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="18*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <MediaElement x:Name="backgroundMusic" MediaFailed="backgroundMusic_MediaFailed" Source="" AudioCategory="BackgroundCapableMedia"></MediaElement>
        <Image Name="imBackground"
               Stretch="UniformToFill"
               Grid.RowSpan="2"
               Grid.ColumnSpan="3"
               PointerPressed="sMainText_PointerPressed"
               >    
        </Image>
        <TextBlock Name="sBackgroundText"
                   Grid.Row="0"
                   Grid.ColumnSpan="3"
               >
        </TextBlock>
        <Border Background="Black" Grid.Row="1" Grid.ColumnSpan="2"  Opacity="0.75">
            <Grid Name="gridText">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="3*"></ColumnDefinition>
                    <ColumnDefinition Width="10*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"></RowDefinition>
                    <RowDefinition Height="3*"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Name="sHeaderText" Grid.RowSpan="2" Grid.ColumnSpan="2" TextWrapping="WrapWholeWords" FontSize="{Binding FontSize}"></TextBlock>
                <TextBlock Name="sMainText"
                   Grid.Row="1"
                   Grid.ColumnSpan="2"
                   PointerPressed="sMainText_PointerPressed"
                   TextWrapping="WrapWholeWords"
                   FontSize="{Binding FontSize}"
                >
                </TextBlock>
                <Image Name="imCharacter"
                       Grid.RowSpan="2"
                       Grid.Column="0"
                       >
                </Image>
                <TextBlock Name="sHeaderTextWithImage" Grid.RowSpan="2" Grid.Column="1" PointerPressed="sMainText_PointerPressed" FontSize="{Binding FontSize}"></TextBlock>
                <TextBlock Name="sMainTextWithImage"
                   Grid.Row="1"
                   Grid.Column="1"
                   PointerPressed="sMainText_PointerPressed"
                   TextWrapping="WrapWholeWords"
                   FontSize="{Binding FontSize}"
                >
                </TextBlock>
            </Grid>
        </Border>
        <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="2">
            <AppBarToggleButton Name="Options" Click="Options_Click" Icon="Setting"></AppBarToggleButton>
        </StackPanel>
        
        <AppBar Name="OptionsBar" Grid.ColumnSpan="2" HorizontalAlignment="Right" VerticalContentAlignment="Bottom" Background="Black" Opacity="0.75">
            <StackPanel>
                <Button Name="Settings" Content="Settings" Click="Settings_Click" Height="50" HorizontalAlignment="Stretch"></Button>
                <Button Name="Save" Content="Save" Click="Save_Click" Height="50"  HorizontalAlignment="Stretch"></Button>
                <Button Name="Load" Content="Load" Click="Load_Click" Height="50"  HorizontalAlignment="Stretch"></Button>
                <Button Name="showHistory" Click="History_Click" Content="History" HorizontalAlignment="Stretch" Height="50"></Button>
                <Button Name="Skip" Content="Skip" HorizontalAlignment="Stretch" Height="50" Click="Skip_Click"></Button>
                <Button Name="Quit" Content="Quit" HorizontalAlignment="Stretch" Height="55" Click="Quit_Click"></Button>
            </StackPanel>
        </AppBar>
    </Grid>
</Page>